package operation;

import data.DataBase;


public class SearchRegister implements IOperation {
    @Override
    public void work(DataBase dataBase) {
        System.out.println("预约信息查询！");
        System.out.print("请输入您的身份证号：");
        String id = scanner.nextLine();
        int currentSize=dataBase.getContainSize();
        for (int i = 0; i < currentSize; i++) {
            if (dataBase.getData(i).getId().equals(id)) {
                System.out.println("预约人："+dataBase.getData(i).getName());
                System.out.println("身份证号："+dataBase.getData(i).getId());
                System.out.println("手机号："+dataBase.getData(i).getPhone());
                System.out.println("预约状态：已预约");
                return;
            }
        }
        System.out.println("不存在预约信息，请先预约！");
    }
}
